var box = SVG('drawing');
// box.rect(100, 100).attr({ fill: '#f06' });
console.log(box);
var polyline = box.polyline('0,0 100,50 50,100').fill('none').stroke({ width: 1 });
var rotate = 0;
box.on("click", function() {
    polyline.animate().rotate(rotate += 45);
    if (rotate >= 180) {
        rotate = -45;
        console.log(rotate);
    }
});